1. Field of the Invention
The invention relates generally to methods and systems for curve-fitting, that is, for approximating a predetermined function by a function having selected characteristics. More specifically, the invention relates to methods and systems for locating a piecewise continuous function represented by a predetermined number of linear segments which approximately corresponds to a predetermined function having monotonically increasing or decreasing characteristics. The invention finds particular utility in connection with the design of compensating input networks for electronic circuits for use with circuit elements or transducers which have nonlinear relationships between the physical phenomena being sensed and the electrical output. An example of such a transducer is a thermocouple, which has monotonically increasing, but non-linear, voltage output as a function of temperature. When used in connection with a thermocouple, the endpoints and the slopes of the linear segments that are found to approximate the thermocouple's voltage-temperature curves are useful in designing resistor networks to be used in amplifier circuits for the thermocouples.
2. Description of the Prior Art
Several systems have been developed for generating mathematical expressions which approximate curves of, for example, scientific data that is graphed as one or more dependent variables which are functions of one or more independent variables. For example, systems using the "least squares" method, as well as others, can find a polynomial expression, or power series, in which a dependent variable can be expressed as a polynomial expression in an independent variable. By inserting into the polynomial expression a value for the independent variable, one can readily determine the value of the dependent variable as a function of the selected value of the independent variable at each point in the domain of interest of the independent variable. Since the polynomial expression is itself an approximation of the observed data, the value determined by use of the expression is an approximation, although often a good one, of the data which had been used to generate the polynomial expression.
The least squares method may be constrained to generate a linear approximation to the observed data, but if the linear approximation is taken over the entire domain, the error, that is, the difference between the data and the approximation, is often quite large. Instead of generating a single approximation over the entire domain, a system can divide the domain into a selected number of regions, and use the least squares method on each region. Even if this technique develops acceptable approximations within each region, two significant problems remain: first, the resulting approximation is, most likely, not continuous across the entire domain, and, second, the approximation most likely does not, at the ends of the domain, equal the data. Both of these are desirable in the development of compensation networks for electronic circuitry. For example, it may be desirable to design an amplifier circuit for use with a thermocouple over a selected temperature range having an input network to compensate for the fact that the thermocouple's voltage output as a function of temperature is not linear. The operating characteristics of most thermocouples are well known, and have been approximated by a power series of voltage output as a function of temperature. The power series functions are fairly complex, and the development of a compensating network from such functions is quite difficult. However, if the operating characteristics are approximated by a linear, or at least a continuous piecewise linear, expression over the entire desired operating range, designing a compensating network from resistors would be a simple matter. Having the approximation fall on the observed data at the endpoints of the domain is desirable in connection with performing gain adjustments on the amplifier circuit.
Instead of using linear least squares approximations, approximations can be generated by dividing the domain into a selected number of regions and forming a linear approximation in each region as the line between the endpoints of the data in the region. In such an approximation, the function is continuous, but since all of the endpoints of the linear segments which approximate the function are constrained to fall on the data being approximated, the error between the linear approximation and the function being unacceptably large at at least some points of the domain.